<template>
	<view>
		<headerView ref="headerView"></headerView>
		<adView ref="adView"></adView>
		<view class="main">
			
		
		<view class="content1">
			
			        
                <view class="cpInfo">
					
				
				<view class="main_body" v-for="data in datas">
					<!-- <view class="content_image">
					<img src="../../../../static/ads/ad3.gif" style="width: 150px; height: 150px; margin: 10px;">
					</img><view class="contentItem" @click="showDetail(qd)">
				</view> -->
					<view @click="showDetail(data)">
						<view class="main_content_title">
							<text>{{data.ZIXUN_ZXBT}}</text>
						</view>
						<view style="display: flex;flex-direction: row; justify-content: center;
						align-items: center; margin-top: 20px;">
					        
							<img :src="data.ZIXUN_ZXTP" v-show="data.hasimage==1" 
							></img>
							<view class="main_content_jianjie">
								{{data.ZIXUN_ZHAIYAO}}
							</view>
						</view>
						
						<view class="userAndTime">
							<view>作者:{{data.ZIXUN_USER}}</view>
							<view>时间：{{data.ZIXUN_FBSJ}}</view>
						</view>
					</view>
				</view>
		</view>
		<contentRight ref="contentRight"></contentRight>
		</view>
		</view>
		<pageView></pageView>
		<footerView></footerView>
	</view>
</template>

<script>
	import headerView from '../header/Headerview.vue'
	import footerView from '../footer/Footer.vue'
	import adView from '../ads/MyAdView.vue'
	import pageView from '../../views/PageView.vue'
	import contentRight from '../mainContent/mainContent_right.vue'
	export default {
		components: {
			headerView,
			adView,
			footerView,
			pageView,
			contentRight,
		},
		created() {

			uni.$on('pageClick', (page) => {

				this.getZiXuns(page);
			})
		},
		data() {
			return {
				datas: [],
				candanIndex: 0,
				tjs: [],
				tiezi_type: null,
				todysTieziSize: 0,

			}
		},
		props: {
			msg: String
		},
		mounted() {
			this.$nextTick(() => {
				this.getZiXuns(1);
			});
			this.$refs.adView.hidSearch();
			this.$refs.adView.showMidAd();
			this.$refs.contentRight.showbtnText("发布资讯","cpDetail");

		},
		onReady() {
			this.$refs.headerView.setIndex(5);
		},
		methods: {
			showDetail(zx){
			console.log("eee: ", zx.ZIXUN_ID);
				uni.navigateTo({
					url: './zixun_detail?id='+zx.ZIXUN_ID,
				})
			},
			async getZiXuns(pageNum) {
				try {
					const res = await this.$getData({
						url: this.$apis.getZiXuns,
						data: {
							page: pageNum,
						}
					})
					this.datas = res.data.data;

				} catch (e) {
					console.log("eee: ", e);
				}
			},


		},
	}
</script>

<style>
	
	.main {
		
		display: flex;
		flex-direction: row;
		justify-content: center;
	}
	
	.content1 {
		display: flex;
		flex-direction: row;
		width: 1200px;
		height: 100%;
		
	}
	.content_info {
		display: flex;
		flex-direction: row;
	}
	.main1 {
		display: flex;
		flex-direction: row;
		align-items: center;
		display: flex;

	}
.cpInfo {
	
		border-bottom: 1px solid #E5E5E5;
		width: 100%;
		display: flex;
		flex-direction: column;
		margin: 5px;

	}
	.main2 {
		display: flex;
		flex-direction: column;
		min-height: 600px;
		align-items: center;
		display: flex;

	}

	.main3 {
		display: flex;
		flex-direction: column;
		min-height: 600px;
		align-items: center;
		display: flex;

	}

	.main_body {
		
		border: 1px solid #E5E5E5;
		display: flex;
		flex-direction: row;
	}

	.main_content {
		border-bottom: 1px solid #E5E5E5;
		flex-direction: column;
		display: flex;


	}

	.main_content {
		display: flex;
		flex-direction: column;
	}

	.content {}

	.main_content_title {
		margin-top: 10px;
		margin-right: 15px;
		margin-left: 15px;
		word-break: break-all;
		color: #FB9E00;
		font-size: 18px;
		font-weight: bold;
	}

	.main_content_jianjie {
		margin-right: 15px;
		margin-left: 15px;
		padding-top: 10px;
		min-height: 100px;
		align-items: center;
		justify-content: center;
		display: flex;
		overflow: hidden;
		word-break: break-all;
		color: #000000;
	}

	.userAndTime {
		margin-right: 15px;
		margin-left: 15px;
		align-items: flex-end;
		margin-bottom: 10px;
		margin-top: 10px;
	}
	img{
		width: 300px;
		height: 130px;
	}
</style>
